Commonly used video encoding/decoding technologies are all based on a hybrid framework, and main coding tools include prediction coding, transform coding, and entropy coding. The prediction coding includes inter-frame prediction coding and intra-frame prediction coding, which remove correlation of video signals in time-domain and correlation of video signals in space-domain respectively.
The inter-frame prediction coding may predict an image of a currently-coded frame according to an image of a coded frame. The prediction residuals are transformed and entropy coded. The coded frame for predicting the currently-coded frame is called a reference frame. A space location relationship between a prediction block on the reference frame and a currently-coded block may be decoded into a motion vector.
With the development of prediction technologies, prediction residuals of an image have been reduced. Accordingly, the proportion of prediction residual information of the image is decreased and the proportion of motion information is increased accordingly in a bit-stream. The efficient coding of a motion vector is important to the performance of video coding.
There are two methods of processing the motion vector in video encoding/decoding. In a first method, an encoder predicates the motion vector after obtaining the motion vector through motion estimation, and then writes a motion vector difference between the motion vector and a predictor of the motion vector to the bit-stream. A decoder predicates the motion vector with the same method, and then reconstructs the motion vector according to the predictor of the motion vector and the motion vector difference read from the bit-stream. In a second method, the encoder/decoder directly derives the motion vector with the same method. In the case of the second method, it is not needed to transmit the motion vector difference in the bit-stream. However, no matter which method is adopted, the motion information needs to be derived. The derived motion information may be the predictor of the motion vector, or the motion vector, or a candidate of the motion vector, or a candidate of the predictor of the motion vector.
In H.264/Advanced Video Coding (AVC), the motion vector is predicted with a median prediction method in an inter-frame prediction mode. In the median prediction method, three coded blocks adjacent to the currently-coded block are selected, a median among horizontal components of motion vectors of the three coded blocks and a median among vertical components of the motion vectors of the three coded blocks are respectively taken as a horizontal component and a vertical component of the predictor of the motion vector of the currently-coded block. In a temporal direct mode, a motion vector of a block on the reference frame that has the same space location as the currently-coded block is scaled and then taken as the motion vector of the currently-coded block.
In Audio Video coding Standard (AVS), the motion vector is predicted with a distance median method in the inter-frame prediction mode. In the distance median method, three coded blocks adjacent to the currently-coded block in space are selected, a distance between each two of motion vectors of the three coded blocks is calculated, and a motion vector corresponding to a median of the calculated distances is taken as the predictor of the motion vector of the currently-coded block. In the temporal direct mode, a motion vector of a block on the reference frame that has the same space location as the currently-coded block is scaled and then taken as the motion vector of the currently-coded block.
In the latest international video coding standard, High Efficiency Video Coding (HEVC), a motion vector competition scheme was introduced. In the motion vector competition scheme, a candidate motion vector set is derived according to a rule, and then an optimal candidate motion vector is selected from the candidate motion vector set and is taken as the predictor of the motion vector of the currently-coded block. Then, the selected motion vector is transmitted in the bit-stream. The candidate motion vector set may include spatial candidate motion vectors and temporal candidate motion vectors. The spatial candidate motion vectors may be selected according to a certain order and priority from motion vectors of upper blocks and left blocks that are adjacent to the currently-coded block. The temporal candidate motion vectors may be selected according to a certain order and priority from motion vectors of blocks on the reference frame that have the same space location as the currently-coded block in space or are adjacent to the currently-coded block in space.
In conventional technologies, the motion vector is derived or predicted only once, and a derived or predicted value is taken as a final motion vector or predictor. However, motion vector differences of blocks that are spatially or temporally adjacent to each other still have correlation, and the correlation between the motion vector differences is not utilized in a conventional video encoding/decoding method. For example, in the motion vector prediction or derivation method based on median or distance, only motion vectors of blocks that are located at the same frame as the currently-coded block are considered, and thus only the correlation between motion vectors in space-domain may be eliminated. However, the motion vector differences still have the correlation between motion vectors in time-domain. In the temporal direct mode of H.264/AVC and AVS, the motion vector derivation method only considers motion vectors of blocks on the reference frame that are located at the same space location as the currently-coded block. The motion vectors derived through this method only exploit temporal correlation but do not consider the correlation between the currently-coded block and the blocks that are adjacent to currently-coded block in the same frame. Accordingly, the derived motion vectors are not optimal. In the motion vector prediction and derivation method based on the competition scheme in HEVC, though both the temporal candidate motion vector and the spatial candidate motion vector are included in the candidate motion vector set and an optimal motion vector is selected, motion vector differences of adjacent blocks still have correlation.